[pull] main from MetaMask:main#348
Merged
Merged
Conversation
…ponents (#23109) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Description** **What is the reason for the change?** The "Token List Item Clicked" Segment event currently sends the same `source` property value (`mobile-token-list`) regardless of whether users click a token from the wallet home page or from the dedicated full token list page. This makes it impossible to differentiate user behavior between these two contexts in analytics. **What is the improvement/solution?** This PR adds differentiation to the token click tracking by introducing a new `source` value: - `mobile-token-list` - sent when tokens are clicked from the wallet home page (existing behavior, maintains backward compatibility) - `mobile-token-list-page` - sent when tokens are clicked from the full token list page (accessed via "View all tokens") The implementation adds an `isFullView` prop that flows through the component hierarchy (`TokensFullView` → `Tokens` → `TokenList` → `TokenListItem/TokenListItemBip44`) and conditionally sets the source property in the Segment tracking event. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: [TMCU-207](https://consensyssoftware.atlassian.net/browse/TMCU-207) ## **Manual testing steps** ```gherkin Feature: Token List Item Click Tracking Differentiation Scenario: user clicks token from wallet home page Given the user is on the wallet home page And tokens are visible in the token list When user taps on any token in the list Then a "Token List Item Clicked" event is sent to Segment And the event contains property source="mobile-token-list" And the user navigates to the token details page Scenario: user clicks token from full token list page Given the user is on the wallet home page And tokens are visible in the token list When user taps "View all tokens" button And user is navigated to the full token list page And user taps on any token in the list Then a "Token List Item Clicked" event is sent to Segment And the event contains property source="mobile-token-list-page" And the user navigates to the token details page ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [TMCU-207]: https://consensyssoftware.atlassian.net/browse/TMCU-207?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds an isFullView prop plumbed through TokenList -> TokenListItem/TokenListItemBip44 to set analytics source to 'mobile-token-list-page' vs 'mobile-token-list', with minor full-view layout padding. > > - **Analytics/Tracking**: > - `TOKEN_DETAILS_OPENED` event now sets `source` based on `isFullView` in `TokenListItem` and `TokenListItemBip44` (`mobile-token-list-page` vs `mobile-token-list`). > - **UI/Props flow**: > - Introduces optional `isFullView` prop on `TokenList`, `TokenListItem`, and `TokenListItemBip44` and passes it through both FlashList rendering and homepage list mapping. > - Applies horizontal padding (`contentContainerStyle`) to `FlashList` when `isFullView` is true. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a75e04b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This is a follow-up to address feedback from #23060. ### Changes - Bumped @metamask/transaction-controller to version ^62.2.0 - Replaced `MUSD_CONVERSION_TRANSACTION_TYPE` with `TransactionType.musdConversion` from transaction-controller - Added `skipInitialGasEstimate: true` when creating mUSD conversion transaction to improve performance. Gas estimate is now calculate asynchronously - Fixed case where user could be redirected to previous page prematurely when calling `initiateConversion` from `useMusdConversion` hook. - Removed transition header from mUSD conversion confirmation screen. We no longer see the default blue back arrow and screen title while navigating to the confirmation screen. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: follow up musd conversion optimizations based on #23060 feedback ## **Related issues** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Switch to TransactionType.musdConversion with async gas estimation, UX tweaks, and controller bump to ^62.2.0. > > - **mUSD conversion flow (Earn)**: > - Use `TransactionType.musdConversion` across hooks, components, and tests (replacing custom `MUSD_CONVERSION_TRANSACTION_TYPE`). > - Create transactions with `skipInitialGasEstimate: true` for faster first paint; add nested transactions; improve error handling to avoid stuck screens. > - Hide header on `REDESIGNED_CONFIRMATIONS` route for a cleaner transition. > - Update confirmation UI to recognize new type: `info-root`, `footer`, `custom-amount-info`, `bridge-fee-row`, and `musd-conversion-info` label/tooltip logic. > - **Controller/engine**: > - Bump `@metamask/transaction-controller` to `^62.2.0` and update Yarn lock; minor init adjustments (registry access, typings). > - **Tests**: > - Update unit tests to reflect new transaction type and async gas estimation behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 865d6a4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Prevent no quotes alert message being displayed inside button. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23098 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a `title` to the `NoPayTokenQuotes` alert and updates tests and English locale strings accordingly. > > - **Alerts** > - Add `title: strings('alert_system.no_pay_token_quotes.title')` to `useNoPayTokenQuotesAlert` in `app/components/Views/confirmations/hooks/alerts/useNoPayTokenQuotesAlert.ts`. > - **Tests** > - Update expectations in `useNoPayTokenQuotesAlert.test.ts` to include `title`. > - **i18n** > - Add `alert_system.no_pay_token_quotes.title` ("No quotes") in `locales/languages/en.json` and keep existing `message`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0650421. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Ensure keyboard is shown on top of modal. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23139 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** <img width="300" alt="Keyboard" src="https://github.com/user-attachments/assets/f90e8f63-1f19-4cde-b278-1e84ed11b29d" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Sets `keyboardAvoidingViewEnabled={false}` on `BottomSheet` in `PayWithModal` to change keyboard behavior. > > - **UI**: > - `app/components/Views/confirmations/components/modals/pay-with-modal/pay-with-modal.tsx` > - Pass `keyboardAvoidingViewEnabled={false}` to `BottomSheet` in `PayWithModal`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 52f6beb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
When displaying network permissions in the
`MultichainPermissionsSummary` component, network avatars without an
`imageSource` property were being passed to the `AvatarGroup` component,
which could result in `undefined` values in the avatars array. This
caused potential rendering issues and inconsistent UI behavior when
displaying network permissions.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed network avatar display issue in permissions when
network images are unavailable
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/860f2212-4930-4f5f-91c9-245d37c31841
### **After**
<!-- [screenshots/recordings] -->
<img width="453" height="908" alt="Screenshot 2025-10-30 at 11 51 44"
src="https://github.com/user-attachments/assets/c8753158-6df7-4a21-ba1e-cc7dad52fae4"
/>
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Filters out non-CAIP wallet scopes when generating network avatars and
adds tests to validate image source calls and chain ID formats.
>
> - **Permissions UI**:
> - In `MultichainAccountPermissions.tsx`, validate and filter
`selectedChainIds` to include only valid CAIP chain IDs and exclude
`wallet:` scopes before creating `networkAvatars` (uses
`isCaipChainId`).
> - **Tests**:
> - Update `MultichainAccountPermissions.test.tsx` to mock
`getNetworkImageSource` and add a `networkAvatars` test ensuring no
`wallet:` scopes are passed and only valid CAIP chain IDs are used.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fce0c16. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description** Prevent infinite loader when updating amount with same value in metamask pay. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23132 #22785 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Avoids unnecessary updates by early-returning when the new token amount equals the current amount, with tests added. > > - **Hooks**: > - Update `useUpdateTokenAmount` to early-return if `newAmountRaw` equals current `amountRaw`, preventing transaction data updates in `useUpdateTokenAmount.ts`. > - **Tests**: > - Add test in `useUpdateTokenAmount.test.ts` asserting no calls to `updateEditableParams` or `updateAtomicBatchData` when amount is unchanged. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit be98771. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Automatically select the highest balance token on any chain in Perps and Predict deposits. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23131 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Simplifies automatic pay token selection to the first available token with balance, falling back to target token when none or on hardware wallets, and updates tests accordingly. > > - **Logic (useAutomaticTransactionPayToken.ts)** > - Replace multi-step selection (target match → highest balance same chain → highest balance alt chain) with simple rule: pick `tokens[0]` if any; otherwise fall back to required target token; always fall back for hardware wallets. > - **Tests (useAutomaticTransactionPayToken.test.ts)** > - Update expectations to select the first available token. > - Remove scenarios around highest-balance and cross-chain selection. > - Keep fallbacks: target token when no tokens, hardware wallets, and disabled state does nothing. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6907490. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Update text colour of Predict claim button in light theme. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23096 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** <img width="300" alt="Claim" src="https://github.com/user-attachments/assets/cf4f7ecc-ba59-48c7-a6a9-88cff992c7c4" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replace Predict claim CTA with ButtonHero and drop light-theme-specific button styling. > > - **Predict Claim Footer (`predict-claim-footer.tsx`)**: > - Replace `Button` with `ButtonHero`; move label to children, remove variant/label props. > - Set `size` to `ButtonBaseSize.Lg` and `isFullWidth`. > - Add imports for `ButtonHero` and `ButtonBaseSize`. > - **Styles (`predict-claim-footer.styles.ts`)**: > - Remove hardcoded `button` style and `lightTheme` dependency; keep container/top/bottom styles. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 44a2213. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )